*********************************************
************* Table 1, Column 1 *************
********************************************* 
clear all
use "/Users/yasenov/Desktop/census raw data/census.dta", clear
gen edgroup = 1 * (educ <= 5) + 2 * (educ == 6) + 3 * (educ == 7 | educ == 8 | educ == 9) ///
	+ 4 * (educ > 9)
	
keep if age >= 19 & age <= 65
gen miami = metarea == 500
keep if miami == 1
keep if year == 1980 
keep if labforce == 2
gen young = age < 25

tab edgroup [fw=perwt]
tab sex [fw=perwt]
tab young [fw=perwt]

keep if edgroup == 1
tab sex [fw=perwt]
tab young [fw=perwt]

*********************************************
************* Table 1, Column 2 *************
*********************************************
use "/Users/yasenov/Desktop/census raw data/census.dta", clear
gen edgroup = 1 * (educ <= 5) + 2 * (educ == 6) + 3 * (educ == 7 | educ == 8 | educ == 9) ///
	+ 4 * (educ > 9)
	
keep if age >= 29	
gen marielito = bpl == 250 & (yrimmig == 1980 | yrimmig == 1981)
keep if year == 1990
keep if marielito == 1  
gen young = age < 35

tab edgroup [fw=perwt]
tab sex [fw=perwt]
tab young [fw=perwt]

keep if edgroup == 1
tab sex [fw=perwt]
tab young [fw=perwt]

*********************************************
************* Table 1, Column 3 *************
*********************************************
use "/Users/yasenov/Desktop/census raw data/census.dta", clear
gen edgroup = 1 * (educ <= 5) + 2 * (educ == 6) + 3 * (educ == 7 | educ == 8 | educ == 9) ///
	+ 4 * (educ > 9)
	
keep if age >= 29	
gen marielito = bpl == 250 & (yrimmig == 1980 | yrimmig == 1981)
gen miami = metarea == 500
keep if miami == 1
keep if year == 1990
keep if marielito == 1  
gen young = age < 35

tab edgroup [fw=perwt]
tab sex [fw=perwt]
tab young [fw=perwt]

keep if edgroup == 1
tab sex [fw=perwt]
tab young [fw=perwt]
